import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@/components/Home.vue'
import D2View from '@/components/D2View.vue'
import D3View from '@/components/D3View.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    meta: {
      keepAlive: true // 是否使用 keep-alive
    }
  },
  {
    path: '/2D',
    name: 'D2View',
    component: D2View,
    meta: {
      keepAlive: true // 是否使用 keep-alive
    }
  },
  {
    path: '/3D',
    name: 'D3View',
    component: D3View,
    meta: {
      keepAlive: true // 是否使用 keep-alive
    }
  }
]

const router = new VueRouter({
  // mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
